﻿using System;
using System.Linq;
using LINQPad.OpenAccess.Data;

namespace LINQPad.OpenAccess.Services
{
    /// <summary>
    /// Application config service
    /// </summary>
    public interface IApplicationConfigService
    {
        /// <summary>
        /// Gets the predefined connections from the specified application config file.
        /// </summary>
        /// <param name="appConfigFilePath">The app config file path.</param>
        /// <returns>
        /// The predefined connections or an empty array.
        /// </returns>
        PredefinedConnectionData[] GetPredefinedConnections( string appConfigFilePath );
        /// <summary>
        /// Tries to get the predefined connections from the specified application config file.
        /// </summary>
        /// <param name="appConfigFilePath">The app config file path.</param>
        /// <param name="predefinedConnections">The predefined connections.</param>
        /// <returns>
        ///   <c>true</c> on success; otherwise, <c>false</c>.
        /// </returns>
        bool TryGetPredefinedConnections( string appConfigFilePath, out PredefinedConnectionData[] predefinedConnections );
    }

}
